﻿
namespace EasyNet.FastDFS
{
    using System.IO;

    class UploadBuffer : IUploadCallback
    {
        public byte[] FileBuffer { get; private set; }

        public int Offset { get; private set; }

        public int Length { get; private set; }

        public UploadBuffer(byte[] fileBuffer, int offset, int length)
        {
            FileBuffer = fileBuffer;
            Offset = offset;
            Length = length;
        }

        public int Send(Stream stream)
        {
            stream.Write(FileBuffer, Offset, Length);

            return 0;
        }
    }
}
